fixed issue with hook and passing parameters