added a version check for hooks