cleans up JS errors