fixed bug in handling default value

pretty sure this fixes the problem i was talking about