pass allowed extensions to onExtError callback
correction
minor corrections
added onBeforeSubmit callback