Input validation added.