changed check for empty to isset so we can return 0s