fix bug where ready not being called in separate javascript file