fixed a crucial bug that prevented an available log filename from being found