updated to work on sub domain