fix some contacts adding and editing bugs