updated with code that actually works on the new server