fix quota calculation