remove whitespace and correct type