added startforeground() and required resources