moved doplay function inside pageinit