updated bug handling