Moving card to page top; fixing JS error