fixed a bug on detecting whether a story had a related resource