changed some delay to setTimeout 2