changed the immediate function