fix flash sizes calculation