fixed null insert bug