Fixed exception being thrown