use Promises, to handle time out