Fixing small jquery bug in toggle function