added cpu instance and added header include safety