Fixed Error creation

Signed-off-by: Alex Fork <4ounder@gmail.com>