add lazy loading
fixed some memory leaks
bug fix