it's stupid to keep c behaviour in javascript. work around it