changed database reference to global

not sure if this is a good idea so it's temporary