Added if condition to return node object from memory with updated attributes