Added check to make sure data is selected when acting as a client