check if elements exist before running the script