Cleaned up potential memory leak