Fixed the script and made it also do property resource filtering