fix order of declaration error