changed $PROMPT_COMMAND to use 'history -w' which seems working in centos and ubuntu ('history -a' was not working on centos)