fixed a bug with calculating the maximum songlength