working threading and scheduler