some fixing to the functions !!