Adding memory guard --kazu