Added resource check