Added function to control the start and end of crawling sequence