Updated to use isFrontend() for setting context properties