added routine activity and fixed runtime crashing