added some hooks and filter