updated log() function and added lftp rc