fixed undefined dereference