made method a little more foolproof