#18 fixed undefined object error