add flock to prevent duplicate instances running on db