Added check so this can be used on webpages