Moved if statement