Fixed the working path at start
Added a try: to max() function (cannot accept an empty list)