added new hooks
fixed query for multisite
Merge pull request #475 from Ritesh-patel/master

new hooks and fix query for multisite