modified for db