fixes input validation