Added some protection incase user double free's