removed callbacks and added promises