moved error sto check