bug fix
bug fix for memory access