fixed insert to return correct value