fixed js warning, anonymous fn does not always return a value