fixed bug in js return value