Added logic to viewscreen