modified for ers still buggy