fixed the logic of showing app