fixing bug caused by validation check