implemented protocol to return data to main view