Added small safeguar to avoid EXC_BAD_ACCESS