add return statements to return promise