Implemented logic for doPost in Attempt Controller