Minor Changes

add a function for waiting