fixing code to work on latest version on more recent coffeescript