fix type bug code