added logic for creating visit