Made validity automatically hide when no validity message to display
Fixed code style