adding backend type checking and param casting