crappy attempt at fixing input from stdin