Fix duplicate query on retry
Bump version to 0.5.1