added exception edge case to junit tests