Solving a small exception issue