moved check a bit further down