Fix #733

Probably there is a best option to fix this bug.
I'm not expert on Javascript.