Fixed page resize function