fix typo that was causing bug of undefined object