get or insert bug and addition of test