Memory error solved