added pre-hook