fix issue of returning promise instead of result