what to know before you apply for a mortgage