input validation added.