Error catching in paste