create screen manger function