bug executing function from command line