memory issues fixing