Validated time input and added sql insert protection