Fixed bug because of missing var declaration (I <3 js)