Updated to work with chaplinjs