added more debug and fixed file paths