fixed javascript errors with refreshable