Return promise. Fix bug