fix out of range

got a "list index out of range" error if no folders opened