added all error checking in add_group