hooks for js