fix out memory exception