add empty bytes check