add validation logic and styling