Catches an id error in jQuery