Added ready event
Fixes after refactoring