fixed a bug in calculate resolution factor