added result existance check, changed the way things are called but that will be changed in the next few commits