refactored and ensured completion block is called