adding listeners and hooks