fix javascript else if