unable to resolve javascript problem