fixed a bug on order of deploy of apps and cleaned up the database.yml