better files loading error detection