Multiplayer Chest Server&Client problem

I’m trying to make a multiplayer inventory and interaction system ad I’ve made a chest for this. Everything works just fine but there is one catch and it happens just one specific situation.
1 - Lets say client opened the chest and menu pops out. Now variable in chest called “InteractingPlayerCount” is 1
2 - Then server did the same thing too and we have total of 2
3 - After these specific actions when client pressed “E” menu is gone but “InteractingPlayerCount” Variable is still 2

I’ve checked besides this scenario it does not happening and works fine. Anyone understands why? Thanks for any help.