heap overflow fix