memory errors fixed