JAVASCRIPT BUGFIX