corrected crud to work with promise