fixed runtime error
fixed runtime error
sometimes pg_close is ran without connection
clean up directory
clean up directory