retrieve max value from database
break statements were missing