fix undefined errors in the footer template
add logic to count when a song has been played enough