Moved invalid checker up a level