Added check to die if resource is not found

Main code rev. 1932