added trim() to input