Fix error where program crash due to resources not being loaded