added changes by pguong