fixed bug in generating name_lastpart