Fixed bug whereby 400 response was being created, but onBeforePageDisplay code was still being invoked