added more logic to AppView