Add more input validation