addded the required options redirect_uri and error handling