added a little validation