Added validty check