moved a pointer reset to a later part since it is causing rashes during event deletion