better server side type checking