Added more validation for input

#63
#51