freeing memory after usage