added extra param on class hook in order to prevent multiple queries

Improve #184 further.