Added error check for application secret parameter