changed to exception as e syntax