Fix code format in promise