fix misplaced function