Changed check_path function first parameter from method get, class Files. Previous parameter "dirname" caused check_path function to return always true so the if statement was skipped.