properly use of local variables