if no file selected - last paint is not getting printed anymore, remove unused instance variable