Add status change function