added controller function