added beforeload event

beforeload event was fired :D