fixing quotes and using document instead of creating a new div