Changed out do_assign to catch exception and convert to return code