fixed out of mem issue