Added check for magic quotes