added pre-hook into commands