Added error checks for memcpydevicetohost too