fixed situation when application closed displayed wrong button