fixed undefined error