change checks from js to coffee