implement lval delete function to clean up memory