Changed from standard submit button handling to buttonPressed parameter handling