tanduy fixed some functions