added exception checking in getSingle