switched the two second delay to an jquery ready() function