better ready function