Fix loss of focus bug. Issue#1