added domready and cleaned up