added more logic for forbidden exception