updated DB script by anoack