Fixed for result NoneType being returned