solved the browser width detection with javascript init issue