back button corrected and logic added to form