bug in initial error check