fixing crash bugs and adding pull to refresh