removed else statement from javascript