fixed error caused by <nil> struct