fix a bug in determine resolution factor