auto release and memory fixes