changed syntax. it works but getting 'undefined'