bugfix: check if array exists
security changes