Handles receiving data