rewrited some functions