Changes on Database; Added support to set temporary directory