added 500ms sleep