added overflow fix