return []byte, error instead of throwing errors