Added config file and fixed null variables bug