addede better width checking