modified the code so it will obey focus by default