bug fixes in reource.coffe