Fixing bug in order scope