Fixed read after free

Signed-off-by: Brandyn A. White <bwhite@dappervision.com>