Fixed bug in clean databases job