implements popActivity and pushActivity