check if serialize and throw error if not to user from R