fixed bugs for f_pressure and f_gravity