Bug Fix: releases can be out of order which causes a deletion of newer releases. this happens if an older release folders last modified time is older than a new release (it does happen). in the case where you only keep 1 release it will remove the only release that current is linking to.

using Capistrano's code to get releases solves this probablem (since it sorts the releases by name instead of last modified time) https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy.rb#L380