little refactoring of js code
bugfix
little bugfix