Fixing the exception like @colinbulll said