switched back to use temp variable