rewritten handling of restricted events
fixed command executor