added logging
onafter event fixed