updated to accept custom view