Fix promise usage