added input validation to app