Fixed wrong scope for  event handler