fixed the error on saving an empty form