Moved initialization inside of condition