If you use in circuit serial programming then you need to load the bootloader file for the 16F877A -20 as well as selecting the 16F877A.

Hope this helps.

Joe