It seems like a larger cvhange but mainly it is only an if-statement added

if attached grid...

instead of the check.