Changed a small mistake with the exception handeling