made conditional more specific to fix bug