added type checking for element param