updated for memory fixes