Obama slams senators who opposed gun measure