Update modal.coffee

Simplify the code