manage tables button logic working