better checking and retun results