memory pointer fix