Working on bug casuing links to nt be inserted into database