Added better validation