Fixed bug with set resoruce.