emits loading and loaded events, adds semi-colons