Fixed the focusing part

Of the focusing/freezing bug