Attempt at fixing exception