Now hook works correctly and waits for indexes to be ready