add tolerance for no focused file

might solve #3 and #4