add resource exist check
add codeclimate