added check for open resource
fix for #610, merged models