added logic to view