fixed bugs in backup detection