some changes for debugging... resources unavailable problem printed out, line56