Stabilised the library so it can work on large folders