calls back with result if callback provided