rewrite process event scheduler to run in the background and fix all bugs related to the hacky way it was initially put together