refactored socket controller
validation on input field