memory isue and checkstyle fix