Fixed error with done event caused by testing existence versus value