Changed title and location change init to onload event