fixed promise typecasting