fixed logging and working also without .js