added geralds suggestion regarding freeing bitmap ressources