memory fixes and fixing core module