javascript all works correctly