fixed database call to use async