Fixed bug if db returns nil it throws an error on get