replace magic number 1 with sizeof