fix crash and remove whitespace