Added magic quotes checking