properly set canvas width