Added code to insert initial detection data