added conditions to try to complete quotes