trying to debug javascript error