wrapped the function into angular module