setup local and env db
fix
fix functions