Fixed js statemtent with else to ensure results