adding back in check for undefined page state