error in order of statements