Getting input in a safer way