fixes focus issue of #142 and #137