moved if outside scope