fixed #32 input validation should trim the data