change the definitions of functions for more shell compatiblity