Removed unused variables and corrected the way an async function is called