Moved reset to doPost